var express = require("express");
var fs = require("fs");

var app = express();

app.use(express.static(__dirname));

app.use("/:postName",function(req,res){
	var pathname = "." + req.params.postName;
	console.log(pathname);
	fs.readFile(pathname,function(err,data){
		if(err){
			res.end("get data failured");
			return;
		};
		res.end(data);
	});
});

app.listen(3000);